<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
	<% %>
		<!DOCTYPE html>
		<html>

		<head>
			<%-- <base href="<%=basePath%>"> --%>
				<title></title>
				<meta name="token" content="Hege Refsnes">
				<meta http-equiv="pragma" content="no-cache">
				<meta http-equiv="cache-control" content="no-cache">
				<meta http-equiv="expires" content="0">
				<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
				<meta http-equiv="description" content="This is my page">
				<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

				<link rel="stylesheet" type="text/css"
					href="<%=basePath%>resourse/jquery-easyui-1.4.5/themes/default/easyui.css">
				<link rel="stylesheet" type="text/css" href="<%=basePath%>resourse/jquery-easyui-1.4.5/themes/icon.css">
				<link rel="stylesheet" type="text/css"
					href="<%=basePath%>resourse/jquery-easyui-1.4.5/themes/color.css">
				<script type="text/javascript" src="<%=basePath%>resourse/jquery-easyui-1.4.5/jquery.min.js"></script>
				<script type="text/javascript"
					src="<%=basePath%>resourse/jquery-easyui-1.4.5/jquery.easyui.min.js"></script>
				<script type="text/javascript"
					src="<%=basePath%>resourse/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js"></script>
				<script type="text/javascript"
					src="<%=basePath%>resourse/jquery-easyui-1.4.5/datagrid-filter.js"></script>
				<script type="text/javascript" src="<%=basePath%>resourse/js/common.js"></script>
				<!-- <link rel="stylesheet" type="text/css" href="resourse/css/login.css"> -->
				<style>
					body {
						font-family: "Helvetica Neue", Helvetica, "PingFang SC",
							"Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
						/* 	margin: 0; */
					}

					#filebg {
						position: absolute;
						left: 0;
						top: 0;
						width: 100%;
						height: 100%;
						opacity: 0.3;
						filter: alpha(opacity=30);
						display: none;
						z-index: 10001;
						background: #ccc;
					}

					#fileshow {
						position: absolute;
						top: 50%;
						margin-top: -20px;
						padding: 10px 5px 10px 30px;
						width: auto;
						height: 16px;
						border-width: 2px;
						border-style: solid;
						display: none;
						border-color: #95B8E7;
						z-index: 10002;
						margin-left: calc(100% / 2 - 100px / 2);
					}

					.file-mask {
						position: fixed;
						width: 100%;
						height: 100%;
						top: 0;
						left: 0;
						background-color: black;
						opacity: .1;
						filter: alpha(opacity=10);
						z-index: 100;
					}
				</style>
		</head>
		<script>
			var PUser = JSON.parse(localStorage.getItem('supplyUser'));
			console.log('PUser:', PUser);
			//var strPer = '${display_permissions}';
			// 	var Permission = '(,' + strPer + ',)';
			//全局添加token
			$(document).ajaxSend(function (event, jqxhr, settings) {
				jqxhr.setRequestHeader('token', localStorage.getItem('tokenSupply'));
				settings.url = '<%=basePath%>api/' + settings.url;
				console.log('setting:', settings.url);
			});
			$(document).ajaxStart(function () {
				load();
			});
			$(document).ajaxStop(function () {
				disLoad();
			});
			$.ajaxSetup({
				complete: function (xhr) {
					//token过期，则跳转到登录页面 
					if (xhr.responseJSON && xhr.responseJSON.code && xhr.responseJSON.code == 60901) {
						window.parent.location.href = '<%=basePath%>supply/login';
					} else if (xhr.responseJSON && xhr.responseJSON.code && xhr.responseJSON.code == 60601) {
						// 				alert(xhr.responseJSON.msg);
					}
				}
			});

			function showFilediv() {
				document.getElementById("filebg").style.display = "block";
				document.getElementById("fileshow").style.display = "block";
			}

			function hideFilediv() {
				document.getElementById("filebg").style.display = 'none';
				document.getElementById("fileshow").style.display = 'none';
			}

			//弹出加载层
			function load() {
				$("<div class=\"datagrid-mask\"></div>").css({
					"display": "block",
					"position": "absolute",
					"left": "0",
					"top": "0",
					"height": "100%",
					// 	        opacity: "0.3", 
					"z-index": "10001",
					"background-color": "white",
					"width": "100%",
					"height": $(window).height()
				}).appendTo("body");
				$("<div class=\"datagrid-mask-msg\"></div>").html("加载中，请稍候...").appendTo("body").css({
					display: "block",
					"z-index": "10002",
					left: ($(document.body).outerWidth(true) - 190) / 2,
					top: ($(window).height() - 45) / 2
				});
			} //取消加载层  
			function disLoad() {
				$(".datagrid-mask").remove();
				$(".datagrid-mask-msg").remove();
			}
		</script>

		<body>
			<div id="filebg"></div>
			<div id="fileshow">加载中，请稍候...</div>
		</body>

		</html>